home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / IPFlakeWay / Squelch Module / source / DCon.h next >
Text File  |  2000-06-23  |  1KB  |  52 lines

  1. #ifndef _DCON_
  2. #define _DCON_
  3.  
  4. #include <MacTypes.h>
  5. #include <stdarg.h>
  6. #include <stdlib.h>
  7.  
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11.  
  12.  
  13. void dopen(const char *log);
  14. void dprintf(const char *format,...);
  15. void vdprintf(const char *format,va_list arg);
  16. void dprintmem(const void *data,size_t len);
  17.  
  18. void dfprintf(const char *log,const char *format,...);
  19. void vdfprintf(const char *log,const char *format,va_list arg);
  20. void dfprintmem(const char *log,const void *data,size_t len);
  21.  
  22.  
  23. #ifndef DCON
  24.     #define DCON        1
  25. #endif
  26.  
  27. #if DCON
  28.     #define dAssertPrint(condition)                dprintf(NULL,"Assert failed: " condition "  %s:%d\n",__FILE__,__LINE__)
  29.     #define dAssertIfTrue(condition)            ((condition) ? dAssertPrint(#condition) : ((void)0))
  30.     #define dAssertIfFalse(condition)            ((condition) ? ((void)0) : dAssertPrint(#condition))
  31.     #define dAssert(condition)                    dAssertIfFalse(condition)
  32. #else
  33.     #define dAssertPrint(condition)                ((void)0)
  34.     #define dAssertIfTrue(condition)            ((condition) ? ((void)0) : ((void)0))
  35.     #define dAssertIfFalse(condition)            ((condition) ? ((void)0) : ((void)0))
  36.     #define dAssert(condition)                    dAssertIfFalse(condition)
  37.     #define dopen                                while(0)
  38.     #define dprintf                                while(0)
  39.     #define vdprintf                            while(0)
  40.     #define dprintmem                            while(0)
  41.     #define dfprintf                            while(0)
  42.     #define vfdprintf                            while(0)
  43.     #define dfprintmem                            while(0)
  44. #endif
  45.  
  46.  
  47. #ifdef __cplusplus
  48. }
  49. #endif
  50.  
  51. #endif /* _DCON_ */
  52.